package _10define._09homework;

public class Animal {
    String name;
    int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void call(){
        System.out.println("该叫了");
    }
}
class Cat extends Animal{
    String color;

    public Cat(String name, int age, String color) {
        super(name, age);
        this.color = color;
    }
    public void call(){
        System.out.println("喵喵喵");
    }

    public void catchMice(){
        System.out.println("抓老鼠了");
    }
}
class Dog extends Animal{
    String gener;
    public void call(){
        System.out.println("汪汪汪");
    }

    public Dog(String name, int age, String gener) {
        super(name, age);
        this.gener = gener;
    }

    public void janitor(){
        System.out.println("看门了");
    }
}
